<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="utf-8">
    <title>JSDoc: Module: utils</title>

    <script src="scripts/prettify/prettify.js"> </script>
    <script src="scripts/prettify/lang-css.js"> </script>
    <!--[if lt IE 9]>
      <script src="//html5shiv.googlecode.com/svn/trunk/html5.js"></script>
    <![endif]-->
    <link type="text/css" rel="stylesheet" href="styles/prettify-tomorrow.css">
    <link type="text/css" rel="stylesheet" href="styles/jsdoc-default.css">
</head>

<body>

<div id="main">

    <h1 class="page-title">Module: utils</h1>

    




<section>

<header>
    
        
    
</header>

<article>
    <div class="container-overview">
    
        

        
    
    </div>

    

    

    
        <h3 class="subsection-title">Classes</h3>

        <dl>
            <dt><a href="module-utils.QueryString.html">QueryString</a></dt>
            <dd></dd>
        
            <dt><a href="module-utils.Storage.html">Storage</a></dt>
            <dd></dd>
        </dl>
    

     

    

    
        <h3 class="subsection-title">Members</h3>

        
            
<h4 class="name" id=".ANDROID_URL"><span class="type-signature">(static, readonly) </span>ANDROID_URL<span class="type-signature"> :string</span></h4>




<div class="description">
    android App下载地址
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">string</span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_env.js.html">utils/env.js</a>, <a href="utils_env.js.html#line34">line 34</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id=".AUTHORIZATION_KEY"><span class="type-signature">(static) </span>AUTHORIZATION_KEY<span class="type-signature"> :string</span></h4>




<div class="description">
    存储鉴权token的key
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">string</span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_storage.js.html">utils/storage.js</a>, <a href="utils_storage.js.html#line153">line 153</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id=".DEVICE_TYPE"><span class="type-signature">(static, readonly) </span>DEVICE_TYPE<span class="type-signature"> :Symbol</span></h4>




<div class="description">
    设备类型
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">Symbol</span>


        </li>
    </ul>





    <h5 class="subsection-title">Properties:</h5>

    

<table class="props">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>PHONE</code></td>
            

            <td class="type">
            
                
<span class="param-type">Symbol</span>


            
            </td>

            

            

            <td class="description last">移动电话</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>PAD</code></td>
            

            <td class="type">
            
                
<span class="param-type">Symbol</span>


            
            </td>

            

            

            <td class="description last">平板</td>
        </tr>

    
    </tbody>
</table>




<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_env.js.html">utils/env.js</a>, <a href="utils_env.js.html#line42">line 42</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
            
<h4 class="name" id=".IOS_URL"><span class="type-signature">(static, readonly) </span>IOS_URL<span class="type-signature"> :string</span></h4>




<div class="description">
    iOS App下载地址
</div>



    <h5>Type:</h5>
    <ul>
        <li>
            
<span class="param-type">string</span>


        </li>
    </ul>





<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_env.js.html">utils/env.js</a>, <a href="utils_env.js.html#line25">line 25</a>
    </li></ul></dd>
    

    

    

    
</dl>






        
    

    
        <h3 class="subsection-title">Methods</h3>

        
            

    

    <h4 class="name" id=".deviceType"><span class="type-signature">(static) </span>deviceType<span class="signature">()</span><span class="type-signature"> &rarr; {Symbol}</span></h4>

    



<div class="description">
    获得<code>设备类型</code>
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_env.js.html">utils/env.js</a>, <a href="utils_env.js.html#line165">line 165</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">Symbol</span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>import { deviceType, DEVICE_TYPE } from 'path/to/utils/env';
if (DEVICE_TYPE.PAD === deviceType()) {
    // TODO: a Pad loads the page
}</code></pre>



        
            

    

    <h4 class="name" id=".isAndroid"><span class="type-signature">(static) </span>isAndroid<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>

    



<div class="description">
    是否是android系统
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_env.js.html">utils/env.js</a>, <a href="utils_env.js.html#line150">line 150</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>import { isAndroid } from 'path/to/utils/env';
if (isAndroid()) {
    // TODO: your page is running in Android Operation System
}</code></pre>



        
            

    

    <h4 class="name" id=".isIOS"><span class="type-signature">(static) </span>isIOS<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>

    



<div class="description">
    是否是iOS系统
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_env.js.html">utils/env.js</a>, <a href="utils_env.js.html#line135">line 135</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>import { isIOS } from 'path/to/utils/env';
if (isIOS()) {
    // TODO: your page is running in iOS Operation System
}</code></pre>



        
            

    

    <h4 class="name" id=".isRunInApp"><span class="type-signature">(static) </span>isRunInApp<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>

    



<div class="description">
    是否运行在App中
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_env.js.html">utils/env.js</a>, <a href="utils_env.js.html#line90">line 90</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>import { isRunInApp } from 'path/to/utils/env';
if (isRunInApp()) {
    // TODO: your page is running in App environment
}</code></pre>



        
            

    

    <h4 class="name" id=".isRunInQQ"><span class="type-signature">(static) </span>isRunInQQ<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>

    



<div class="description">
    是否运行在QQ中
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_env.js.html">utils/env.js</a>, <a href="utils_env.js.html#line120">line 120</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>import { isRunInQQ } from 'path/to/utils/env';
if (isRunInQQ) {
    // TODO: your page is running in QQ environment
}</code></pre>



        
            

    

    <h4 class="name" id=".isRunInWeChat"><span class="type-signature">(static) </span>isRunInWeChat<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>

    



<div class="description">
    是否运行在微信中
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_env.js.html">utils/env.js</a>, <a href="utils_env.js.html#line105">line 105</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>import { isRunInWeChat } from 'path/to/utils/env';
if (isRunInWeChat()) {
    // TODO: your page is running in WeChat environment
}</code></pre>



        
            

    

    <h4 class="name" id=".isStudent"><span class="type-signature">(static) </span>isStudent<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>

    



<div class="description">
    是否是学生
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_env.js.html">utils/env.js</a>, <a href="utils_env.js.html#line60">line 60</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>import { isStudent } from 'path/to/utils/env';
if (isStudent()) {
    // TODO: A student is reading the page
}</code></pre>



        
            

    

    <h4 class="name" id=".isTeacher"><span class="type-signature">(static) </span>isTeacher<span class="signature">()</span><span class="type-signature"> &rarr; {boolean}</span></h4>

    



<div class="description">
    是否是老师
</div>













<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_env.js.html">utils/env.js</a>, <a href="utils_env.js.html#line75">line 75</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">boolean</span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>import { isTeacher } from 'path/to/utils/env';
if (isTeacher()) {
    // TODO: A teacher is reading the page
}</code></pre>



        
            

    

    <h4 class="name" id=".openBrowser"><span class="type-signature">(static) </span>openBrowser<span class="signature">(url)</span><span class="type-signature"> &rarr; {undefined}</span></h4>

    



<div class="description">
    打开用户默认浏览器浏览器
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>url</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">移动端浏览器默认加载的地址</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    
    <dt class="tag-author">Author:</dt>
    <dd class="tag-author">
        <ul>
            <li>Nixon</li>
        </ul>
    </dd>
    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_hybird.js.html">utils/hybird.js</a>, <a href="utils_hybird.js.html#line79">line 79</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">undefined</span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>import { openBrowser } from 'path/to/utils/hybird';
openBrowser('http://knowbox.com');</code></pre>



        
            

    

    <h4 class="name" id=".openNewWindow"><span class="type-signature">(static) </span>openNewWindow<span class="signature">(url, title)</span><span class="type-signature"> &rarr; {undefined}</span></h4>

    



<div class="description">
    打开新窗口
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>url</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">新窗口加载的地址</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>title</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">新窗口显示的标题</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_hybird.js.html">utils/hybird.js</a>, <a href="utils_hybird.js.html#line91">line 91</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">undefined</span>


    </dd>
</dl>

    



        
            

    

    <h4 class="name" id=".require"><span class="type-signature">(static) </span>require<span class="signature">(resource, done)</span><span class="type-signature"></span></h4>

    



<div class="description">
    按需加载js资源
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>resource</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">目标js资源地址</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>done</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last">资源加载完成时调用的函数</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_require.js.html">utils/require.js</a>, <a href="utils_require.js.html#line7">line 7</a>
    </li></ul></dd>
    

    

    

    
</dl>















    <h5>Example</h5>
    
    <pre class="prettyprint"><code>import require from 'path/to/utils/require';
require('http://knowbox.com/js/a.js', () => {
    // TODO: call a method which is in a.js
});</code></pre>



        
            

    

    <h4 class="name" id=".sendMessage"><span class="type-signature">(static) </span>sendMessage<span class="signature">(target, options<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {function}</span></h4>

    



<div class="description">
    发送消息给移动端
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>target</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last">hybird协议</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>options</code></td>
            

            <td class="type">
            
                
<span class="param-type">json</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">协议参数配置</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_hybird.js.html">utils/hybird.js</a>, <a href="utils_hybird.js.html#line45">line 45</a>
    </li></ul></dd>
    

    

    
    <dt class="tag-see">See:</dt>
    <dd class="tag-see">
        <ul>
            <li><a href="module-constants_api.MOBILE_API.html">module:constants/api.MOBILE_API</a></li>
        </ul>
    </dd>
    

    
</dl>













<h5>Returns:</h5>

        
<div class="param-desc">
    被执行的命令
</div>



<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">function</span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>import { sendMessage } from 'path/to/utils/hybird';
import { MOBILE_API } from 'path/to/constants/api';
sendMessage(MOBILE_API.OPEN_NEW_WINDOW_URL, { url: 'http://knowbox.com', title: '作业盒子官网' });</code></pre>



        
            

    

    <h4 class="name" id=".setupQQ"><span class="type-signature">(static) </span>setupQQ<span class="signature">(targetURL, title, desc)</span><span class="type-signature"> &rarr; {undefined}</span></h4>

    



<div class="description">
    设置QQ分享
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>targetURL</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">分享的地址</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>title</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">分享标题</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>desc</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">分享文案</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_share.js.html">utils/share.js</a>, <a href="utils_share.js.html#line104">line 104</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">undefined</span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>import { setupQQ } from 'path/to/utils/share';
setupQQ('http://knowbox.com/share.html', '分享标题', '分享文案');</code></pre>



        
            

    

    <h4 class="name" id=".setupShare"><span class="type-signature">(static) </span>setupShare<span class="signature">(targetURL, title, desc)</span><span class="type-signature"> &rarr; {undefined}</span></h4>

    



<div class="description">
    设置分享, 包括QQ和weChat, 懒人方法
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>targetURL</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">分享的地址</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>title</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">分享标题</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>desc</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">分享文案</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_share.js.html">utils/share.js</a>, <a href="utils_share.js.html#line136">line 136</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">undefined</span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>import { setupShare } from 'path/to/utils/share';
setupShare('http://knowbox.com/share.html', '分享标题', '分享文案');</code></pre>



        
            

    

    <h4 class="name" id=".setupWeChat"><span class="type-signature">(static) </span>setupWeChat<span class="signature">(targetURL, title, desc)</span><span class="type-signature"> &rarr; {undefined}</span></h4>

    



<div class="description">
    设置微信分享
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>targetURL</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">分享的地址</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>title</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">分享标题</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>desc</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">分享文案</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_share.js.html">utils/share.js</a>, <a href="utils_share.js.html#line55">line 55</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">undefined</span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>import { setupWeChat } from 'path/to/utils/share';
setupWeChat('http://knowbox.com/share.html', '分享标题', '分享文案');</code></pre>



        
            

    

    <h4 class="name" id=".share"><span class="type-signature">(static) </span>share<span class="signature">(platform, text, title, imageUrl, titleUrl, url, description, site, handler)</span><span class="type-signature"> &rarr; {undefined}</span></h4>

    



<div class="description">
    利用端上接口分享信息
</div>









    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>platform</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">平台</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>text</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">分享文案</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>title</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">分享标题</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>imageUrl</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">分享图片Logo</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>titleUrl</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">标题链接</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>url</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">分享的链接地址</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>description</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">描述</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>site</code></td>
            

            <td class="type">
            
                
<span class="param-type">string</span>


            
            </td>

            

            

            <td class="description last">来源</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>handler</code></td>
            

            <td class="type">
            
                
<span class="param-type">function</span>


            
            </td>

            

            

            <td class="description last">回调函数</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_hybird.js.html">utils/hybird.js</a>, <a href="utils_hybird.js.html#line123">line 123</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">undefined</span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>import { share } from 'path/to/utils/hybird';
share(
    "现在来参加. 2分钟可立刻知道你的词汇量. 还能顺手拿好礼",
    "http://knowbox.com/favicon.png",
    "同学们, 快来参加"中学生英语单词竞赛",
    "http://activity.knowbox.com/invite.html",
    "http://activity.knowbox.com/invite.html",
    "活动",
    "作业盒子老师端",
    "http://hzapp.knowbox.cn",
    function() {  }
);</code></pre>



        
            

    

    <h4 class="name" id=".toFixed"><span class="type-signature">(static) </span>toFixed<span class="signature">(origin, num<span class="signature-attributes">opt</span>)</span><span class="type-signature"> &rarr; {number}</span></h4>

    











    <h5>Parameters:</h5>
    

<table class="params">
    <thead>
    <tr>
        
        <th>Name</th>
        

        <th>Type</th>

        
        <th>Attributes</th>
        

        

        <th class="last">Description</th>
    </tr>
    </thead>

    <tbody>
    

        <tr>
            
                <td class="name"><code>origin</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                

                

                
                </td>
            

            

            <td class="description last">原数值</td>
        </tr>

    

        <tr>
            
                <td class="name"><code>num</code></td>
            

            <td class="type">
            
                
<span class="param-type">number</span>


            
            </td>

            
                <td class="attributes">
                
                    &lt;optional><br>
                

                

                
                </td>
            

            

            <td class="description last">保留位数</td>
        </tr>

    
    </tbody>
</table>






<dl class="details">

    

    

    

    

    

    

    

    

    

    

    

    

    
    <dt class="tag-source">Source:</dt>
    <dd class="tag-source"><ul class="dummy"><li>
        <a href="utils_number.js.html">utils/number.js</a>, <a href="utils_number.js.html#line18">line 18</a>
    </li></ul></dd>
    

    

    

    
</dl>













<h5>Returns:</h5>

        


<dl>
    <dt>
        Type
    </dt>
    <dd>
        
<span class="param-type">number</span>


    </dd>
</dl>

    


    <h5>Example</h5>
    
    <pre class="prettyprint"><code>import { toFixed } from 'path/to/utils/number';
const origin = 3.1415926;
toFixed(origin, 2); // output 3.14</code></pre>



        
    

    

    
</article>

</section>




</div>

<nav>
    <h2><a href="index.html">Home</a></h2><h3>Modules</h3><ul><li><a href="module-components_containers.html">components/containers</a></li><li><a href="module-components_dumb.html">components/dumb</a></li><li><a href="module-constants_api.html">constants/api</a></li><li><a href="module-constants_http.html">constants/http</a></li><li><a href="module-net_httpProxy.html">net/httpProxy</a></li><li><a href="module-utils.html">utils</a></li></ul><h3>Classes</h3><ul><li><a href="module-components_containers.Welcome.html">Welcome</a></li><li><a href="module-components_dumb.MarqueeLine.html">MarqueeLine</a></li><li><a href="module-utils.QueryString.html">QueryString</a></li><li><a href="module-utils.Storage.html">Storage</a></li></ul>
</nav>

<br class="clear">

<footer>
    Documentation generated by <a href="https://github.com/jsdoc3/jsdoc">JSDoc 3.4.3</a> on Thu Feb 09 2017 17:36:20 GMT+0800 (CST)
</footer>

<script> prettyPrint(); </script>
<script src="scripts/linenumber.js"> </script>
</body>
</html>